let id = pkg.get_package_id().clone();
if stage == StageStart {
- let fresh = fresh.combine(self.state[pkg.get_package_id()]);
- let msg = match fresh { Fresh => "Fresh", Dirty => "Compiling" };
- try!(config.shell().status(msg, pkg));
+ match fresh.combine(self.state[pkg.get_package_id()]) {
+ Fresh => try!(config.shell().verbose(|c| {
+ c.status("Fresh", pkg)
+ })),
+ Dirty => try!(config.shell().status("Compiling", pkg))
+ }
}
// While the jobs are all running, we maintain some metadata about how
assert_that(p.process(cargo_dir().join("cargo")).arg("bench"),
execs().with_status(0)
.with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
{running} target[..]release[..]foo-[..]
running 1 test
test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
",
- fresh = FRESH, running = RUNNING,
- dir = p.url()).as_slice()));
+ running = RUNNING)));
})
use std::path;
use support::{ResultTest, project, execs, main_file, basic_bin_manifest};
-use support::{COMPILING, RUNNING, FRESH, cargo_dir, ProjectBuilder, path2url};
+use support::{COMPILING, RUNNING, cargo_dir, ProjectBuilder, path2url};
use hamcrest::{assert_that, existing_file};
use support::paths::PathExt;
use cargo;
println!("first pass");
assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
execs().with_status(0)
- .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+ .with_stdout(""));
// Modify an ignored file and make sure we don't rebuild
println!("second pass");
File::create(&foo.root().join("src/bar.rs")).assert();
assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
execs().with_status(0)
- .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+ .with_stdout(""));
})
test!(rebuild_preserves_out_dir {
use support::{ProjectBuilder, ResultTest, project, execs, main_file, paths};
use support::{cargo_dir, path2url};
-use support::{COMPILING, FRESH, UPDATING, RUNNING};
+use support::{COMPILING, UPDATING, RUNNING};
use support::paths::PathExt;
use hamcrest::{assert_that,existing_file};
use cargo;
// Don't recompile the second time
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
- {} foo v0.5.0 ({})\n",
- FRESH, git_project.url(),
- FRESH, p.url())));
+ execs().with_stdout(""));
// Modify a file manually, shouldn't trigger a recompile
File::create(&git_project.root().join("src/bar.rs")).write_str(r#"
"#).assert();
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
- {} foo v0.5.0 ({})\n",
- FRESH, git_project.url(),
- FRESH, p.url())));
+ execs().with_stdout(""));
assert_that(p.process(cargo_dir().join("cargo")).arg("update"),
execs().with_stdout(format!("{} git repository `{}`",
git_project.url())));
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
- {} foo v0.5.0 ({})\n",
- FRESH, git_project.url(),
- FRESH, p.url())));
+ execs().with_stdout(""));
// Commit the changes and make sure we don't trigger a recompile because the
// lockfile says not to change
println!("compile after commit");
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
- {} foo v0.5.0 ({})\n",
- FRESH, git_project.url(),
- FRESH, p.url())));
+ execs().with_stdout(""));
p.root().move_into_the_past().assert();
// Update the dependency and carry on!
println!("first pass");
assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
execs().with_status(0)
- .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+ .with_stdout(""));
// Modify an ignored file and make sure we don't rebuild
println!("second pass");
File::create(&foo.root().join("src/bar.rs")).assert();
assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
execs().with_status(0)
- .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+ .with_stdout(""));
})
test!(git_name_not_always_needed {
use std::io::{fs, File, UserRWX};
use support::{ResultTest, project, execs, main_file, cargo_dir, path2url};
-use support::{COMPILING, FRESH, RUNNING};
+use support::{COMPILING, RUNNING};
use support::paths::{mod, PathExt};
use hamcrest::{assert_that, existing_file};
use cargo;
COMPILING, p.url())));
// This time we shouldn't compile bar
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
- {} foo v0.5.0 ({})\n",
- FRESH, bar,
- FRESH, p.url())));
+ execs().with_stdout(""));
p.root().move_into_the_past().assert();
p.build(); // rebuild the files (rewriting them in the process)
COMPILING, bar,
COMPILING, p.url())));
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
- {} bar v0.5.0 ({})\n\
- {} foo v0.5.0 ({})\n",
- FRESH, baz,
- FRESH, bar,
- FRESH, p.url())));
+ execs().with_stdout(""));
// Make sure an update to baz triggers a rebuild of bar
//
pub fn bar() { println!("hello!"); baz::baz(); }
"#).assert();
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
- {} bar v0.5.0 ({})\n\
+ execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
{} foo v0.5.0 ({})\n",
- FRESH, baz,
COMPILING, bar,
COMPILING, p.url())));
+
})
test!(no_rebuild_two_deps {
COMPILING, p.url())));
assert_that(&p.bin("foo"), existing_file());
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
- {} bar v0.5.0 ({})\n\
- {} foo v0.5.0 ({})\n",
- FRESH, baz,
- FRESH, bar,
- FRESH, p.url())));
+ execs().with_stdout(""));
assert_that(&p.bin("foo"), existing_file());
})
// This shouldn't recompile `bar`
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
- {} foo v0.5.0 ({})\n",
- FRESH, bar,
+ execs().with_stdout(format!("{} foo v0.5.0 ({})\n",
COMPILING, p.url())));
})
use support::{project, execs, cargo_dir, path2url};
-use support::{COMPILING, FRESH};
+use support::COMPILING;
use hamcrest::{assert_that, existing_file, existing_dir, is_not};
fn setup() {
dir = path2url(p.root())).as_slice()));
assert_that(p.process(cargo_dir().join("cargo")).arg("doc"),
- execs().with_status(0).with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
-",
- fresh = FRESH,
- dir = path2url(p.root())).as_slice()));
+ execs().with_status(0).with_stdout(""))
})
test!(doc_deps {
assert_that(p.process(cargo_dir().join("cargo")).arg("doc")
.env("RUST_LOG", Some("cargo::ops::cargo_rustc::fingerprint")),
- execs().with_status(0).with_stdout(format!("\
-{fresh} bar v0.0.1 ({dir})
-{fresh} foo v0.0.1 ({dir})
-",
- fresh = FRESH,
- dir = path2url(p.root())).as_slice()));
+ execs().with_status(0).with_stdout(""));
assert_that(&p.root().join("target/doc"), existing_dir());
assert_that(&p.root().join("target/doc/foo/index.html"), existing_file());
use std::io::{fs, File};
use support::{project, execs, path2url};
-use support::{COMPILING, cargo_dir, ResultTest, FRESH};
+use support::{COMPILING, cargo_dir, ResultTest};
use support::paths::PathExt;
use hamcrest::{assert_that, existing_file};
", compiling = COMPILING, dir = path2url(p.root()))));
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
- execs().with_status(0).with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
-", fresh = FRESH, dir = path2url(p.root()))));
+ execs().with_status(0).with_stdout(""));
p.root().move_into_the_past().assert();
File::create(&p.root().join("src/a.rs")).write_str("fn main() {}").assert();
use std::str;
use support::{project, execs, basic_bin_manifest, basic_lib_manifest};
-use support::{COMPILING, cargo_dir, ResultTest, FRESH, RUNNING, DOCTEST};
+use support::{COMPILING, cargo_dir, ResultTest, RUNNING, DOCTEST};
use support::paths::PathExt;
use hamcrest::{assert_that, existing_file};
use cargo::util::process;
assert_that(p.process(cargo_dir().join("cargo")).arg("test"),
execs().with_status(0)
.with_stdout(format!("\
-{fresh} bar v0.0.1 ({dir})
-{fresh} foo v0.0.1 ({dir})
{running} target[..]foo-[..]
running 1 test
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- fresh = FRESH, running = RUNNING,
- doctest = DOCTEST,
- dir = p.url()).as_slice()));
+ running = RUNNING,
+ doctest = DOCTEST)));
+
})
test!(test_twice_with_build_cmd {
assert_that(p.process(cargo_dir().join("cargo")).arg("test"),
execs().with_status(0)
.with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
{running} target[..]foo-[..]
running 1 test
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
",
- fresh = FRESH, running = RUNNING,
- doctest = DOCTEST,
- dir = p.url()).as_slice()));
+ running = RUNNING,
+ doctest = DOCTEST)));
})
test!(test_then_build {
assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
execs().with_status(0)
- .with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
-",
- fresh = FRESH,
- dir = p.url()).as_slice()));
+ .with_stdout(""));
})
test!(test_no_run {